﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace PoemGame.Domain.PlayerAggregate
{
    public interface IPlayerRepository
    {
        /// <summary>
        /// 根据用户名获取玩家
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        Task<Player?> GetPlayerByUserNameAsync(string username);
        /// <summary>
        /// 根据用户Id获取玩家
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Player?> GetPlayerByIdAsync(Guid id);
        /// <summary>
        /// 添加玩家
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        Task<Guid> AddAsync(Player player);
        /// <summary>
        /// 删除玩家
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        Task RemoveAsync(Player player);
        /// <summary>
        /// 更新玩家
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        Task UpdateAsync(Player player);
        /// <summary>
        /// 获取所有玩家
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<Player>> GetAllAsync();
        /// <summary>
        /// 根据条件获取玩家
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        Task<IEnumerable<Player>> GetByConditionAsync(Expression<Func<Player, bool>> predicate);
    }
}
